/****** Object:  Stored Procedure [dbo].spChiTietBienBanKiemKeKhoSelectAllByMaBBKKK Script Date: 7/16/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spBienBanKiemKeKhoGetForPrint]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spBienBanKiemKeKhoGetForPrint]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		17/07/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spBienBanKiemKeKhoGetForPrint]
(
	@MaBBKKK nvarchar(12)
)
WITH ENCRYPTION

AS

SET NOCOUNT ON

SELECT 
	*
FROM [tbl_ChiTietBienBanKiemKeKho] INNER JOIN tbl_luukho ON tbl_ChiTietBienBanKiemKeKho.maluukho = tbl_luukho.maluukho
	INNER JOIN tbl_BienBanKiemKeKho ON tbl_BienBanKiemKeKho.MaBBKKK=[tbl_ChiTietBienBanKiemKeKho].MaBBKKK
	INNER JOIN tbl_SanPham ON tbl_SanPham.Mathuoc = tbl_luukho.Mathuoc
WHERE tbl_BienBanKiemKeKho.[MaBBKKK] = @MaBBKKK

select * from tbl_Congty

GO

--GRANT EXECUTE ON [dbo].[spChiTietBienBanKiemKeKhoSelectAllByMaBBKKK] TO [sa]
--GO
